@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

:root {
    --forest-dark: #1a472a;
    --forest-light: #2ecc71;
    --wood-brown: #8B4513;
    --leaf-green: #66bb6a;
    --sky-blue: #87CEEB;
    --card-size: 80px;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, var(--forest-dark) 0%, var(--forest-light) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.forest-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.1;
    z-index: -1;
}

.game-container {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

h1 {
    text-align: center;
    color: var(--forest-dark);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--wood-brown);
    font-weight: 600;
}

.difficulty-selector {
    margin-bottom: 20px;
}

.game-board {
    display: grid;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.card {
    width: var(--card-size);
    height: var(--card-size);
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-front {
    background: linear-gradient(135deg, var(--leaf-green) 0%, var(--forest-light) 100%);
    border: 2px solid var(--forest-dark);
}

.card-front::before {
    content: "🍃";
    font-size: 1.5rem;
    opacity: 0.5;
}

.card-back {
    background-color: white;
    transform: rotateY(180deg);
    font-size: 2rem;
    border: 2px solid var(--forest-dark);
}

button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: var(--forest-dark);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    transition: background-color 0.3s, transform 0.1s;
}

button:hover {
    background-color: var(--forest-light);
}

button:active {
    transform: scale(0.98);
}

select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--forest-dark);
    font-size: 1rem;
    color: var(--forest-dark);
    background-color: white;
    cursor: pointer;
}

@media (max-width: 768px) {
    :root {
        --card-size: 60px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .game-info {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    :root {
        --card-size: 50px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .game-info {
        font-size: 0.9rem;
    }
    
    .card-front::before {
        font-size: 1rem;
    }
    
    .card-back {
        font-size: 1.5rem;
    }
}